<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.9.1"/>
<title>IDA SDK: Convenience functions</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<script type="text/javascript">
  $(document).ready(function() { init_search(); });
</script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td style="padding-left: 0.5em;">
   <div id="projectname">IDA SDK
   </div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.9.1 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>Main&#160;Page</span></a></li>
      <li><a href="files.html"><span>Header&#160;Files</span></a></li>
      <li><a href="annotated.html"><span>Classes</span></a></li>
      <li><a href="modules.html"><span>Modules</span></a></li>
      <li>
        <div id="MSearchBox" class="MSearchBoxInactive">
        <span class="left">
          <img id="MSearchSelect" src="search/mag_sel.png"
               onmouseover="return searchBox.OnSearchSelectShow()"
               onmouseout="return searchBox.OnSearchSelectHide()"
               alt=""/>
          <input type="text" id="MSearchField" value="Search" accesskey="S"
               onfocus="searchBox.OnSearchFieldFocus(true)" 
               onblur="searchBox.OnSearchFieldFocus(false)" 
               onkeyup="searchBox.OnSearchFieldChange(event)"/>
          </span><span class="right">
            <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
          </span>
        </div>
      </li>
    </ul>
  </div>
</div><!-- top -->
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div class="header">
  <div class="summary">
<a href="#func-members">Functions</a>  </div>
  <div class="headertitle">
<div class="title">Convenience functions<div class="ingroups"><a class="el" href="group__color__def.html">Color definitions</a></div></div>  </div>
</div><!--header-->
<div class="contents">
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<p>Higher level convenience functions are defined in <a class="el" href="ua_8hpp.html" title="Functions that deal with the disassembling of program instructions. ">ua.hpp</a>. </p>
<p>Please use the following functions only if functions from <a class="el" href="ua_8hpp.html" title="Functions that deal with the disassembling of program instructions. ">ua.hpp</a> are not useful in your case. </p>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="func-members"></a>
Functions</h2></td></tr>
<tr class="memitem:gaf76614959962607fe1e631dff76cfccd"><td class="memItemLeft" align="right" valign="top"><a class="el" href="pro_8h.html#a8ddba56b40c4be92718f8059abf51147">idaman</a> void <a class="el" href="pro_8h.html#a176294e75f953787714b9d08ffa89adf">ida_export</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__color__conv.html#gaf76614959962607fe1e631dff76cfccd">tag_addr</a> (<a class="el" href="pro_8h.html#a386c10c6aa4340f1d63df85f40454fce">qstring</a> *buf, <a class="el" href="pro_8h.html#a7b0aeaed04e477c02cf8ea3452002d1a">ea_t</a> ea, bool ins=false)</td></tr>
<tr class="memdesc:gaf76614959962607fe1e631dff76cfccd"><td class="mdescLeft">&#160;</td><td class="mdescRight">Insert an address mark into a string.  <a href="#gaf76614959962607fe1e631dff76cfccd">More...</a><br /></td></tr>
<tr class="separator:gaf76614959962607fe1e631dff76cfccd"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga744af50ffec085fea47b9fcd34b366f2"><td class="memItemLeft" align="right" valign="top"><a class="el" href="pro_8h.html#a8ddba56b40c4be92718f8059abf51147">idaman</a> const char *<a class="el" href="pro_8h.html#a176294e75f953787714b9d08ffa89adf">ida_export</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__color__conv.html#ga744af50ffec085fea47b9fcd34b366f2">tag_advance</a> (const char *line, int cnt)</td></tr>
<tr class="memdesc:ga744af50ffec085fea47b9fcd34b366f2"><td class="mdescLeft">&#160;</td><td class="mdescRight">Move pointer to a 'line' to 'cnt' positions right.  <a href="#ga744af50ffec085fea47b9fcd34b366f2">More...</a><br /></td></tr>
<tr class="separator:ga744af50ffec085fea47b9fcd34b366f2"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga772d3586086dab8060e30ca75a40588f"><td class="memItemLeft" align="right" valign="top"><a class="el" href="pro_8h.html#a8ddba56b40c4be92718f8059abf51147">idaman</a> const char *<a class="el" href="pro_8h.html#a176294e75f953787714b9d08ffa89adf">ida_export</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__color__conv.html#ga772d3586086dab8060e30ca75a40588f">tag_skipcodes</a> (const char *line)</td></tr>
<tr class="memdesc:ga772d3586086dab8060e30ca75a40588f"><td class="mdescLeft">&#160;</td><td class="mdescRight">Move the pointer past all color codes.  <a href="#ga772d3586086dab8060e30ca75a40588f">More...</a><br /></td></tr>
<tr class="separator:ga772d3586086dab8060e30ca75a40588f"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga8a7428cd65bc8e7630c88460f6790daa"><td class="memItemLeft" align="right" valign="top"><a class="el" href="pro_8h.html#a8ddba56b40c4be92718f8059abf51147">idaman</a> const char *<a class="el" href="pro_8h.html#a176294e75f953787714b9d08ffa89adf">ida_export</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__color__conv.html#ga8a7428cd65bc8e7630c88460f6790daa">tag_skipcode</a> (const char *line)</td></tr>
<tr class="memdesc:ga8a7428cd65bc8e7630c88460f6790daa"><td class="mdescLeft">&#160;</td><td class="mdescRight">Skip one color code.  <a href="#ga8a7428cd65bc8e7630c88460f6790daa">More...</a><br /></td></tr>
<tr class="separator:ga8a7428cd65bc8e7630c88460f6790daa"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga0cfacbd2eae7cf9b49b3df37422a020d"><td class="memItemLeft" align="right" valign="top"><a class="el" href="pro_8h.html#a8ddba56b40c4be92718f8059abf51147">idaman</a> <a class="el" href="pro_8h.html#ab65ed42d67e6c517c746ff2a6a187016">ssize_t</a> <a class="el" href="pro_8h.html#a176294e75f953787714b9d08ffa89adf">ida_export</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__color__conv.html#ga0cfacbd2eae7cf9b49b3df37422a020d">tag_strlen</a> (const char *line)</td></tr>
<tr class="memdesc:ga0cfacbd2eae7cf9b49b3df37422a020d"><td class="mdescLeft">&#160;</td><td class="mdescRight">Calculate length of a colored string This function computes the length in unicode codepoints of a line.  <a href="#ga0cfacbd2eae7cf9b49b3df37422a020d">More...</a><br /></td></tr>
<tr class="separator:ga0cfacbd2eae7cf9b49b3df37422a020d"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gab05c8906f67ec00e4f3281ba8a67982e"><td class="memItemLeft" align="right" valign="top"><a class="el" href="pro_8h.html#a8ddba56b40c4be92718f8059abf51147">idaman</a> <a class="el" href="pro_8h.html#ab65ed42d67e6c517c746ff2a6a187016">ssize_t</a> <a class="el" href="pro_8h.html#a176294e75f953787714b9d08ffa89adf">ida_export</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__color__conv.html#gab05c8906f67ec00e4f3281ba8a67982e">tag_remove</a> (<a class="el" href="pro_8h.html#a386c10c6aa4340f1d63df85f40454fce">qstring</a> *buf, const char *str, int init_level=0)</td></tr>
<tr class="memdesc:gab05c8906f67ec00e4f3281ba8a67982e"><td class="mdescLeft">&#160;</td><td class="mdescRight">Remove color escape sequences from a string.  <a href="#gab05c8906f67ec00e4f3281ba8a67982e">More...</a><br /></td></tr>
<tr class="separator:gab05c8906f67ec00e4f3281ba8a67982e"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga68d0ed2d458be67147083d6cbdfbdc4c"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ga68d0ed2d458be67147083d6cbdfbdc4c"></a>
<a class="el" href="pro_8h.html#ab65ed42d67e6c517c746ff2a6a187016">ssize_t</a> <a class="el" href="pro_8h.html#a6505e7ff3b129d8b17258304886fd133">idaapi</a>&#160;</td><td class="memItemRight" valign="bottom"><b>tag_remove</b> (<a class="el" href="pro_8h.html#a386c10c6aa4340f1d63df85f40454fce">qstring</a> *buf, const <a class="el" href="pro_8h.html#a386c10c6aa4340f1d63df85f40454fce">qstring</a> &amp;str, int init_level=0)</td></tr>
<tr class="separator:ga68d0ed2d458be67147083d6cbdfbdc4c"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga1cb733a342fb34eb43b7477bd7a409e9"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ga1cb733a342fb34eb43b7477bd7a409e9"></a>
<a class="el" href="pro_8h.html#ab65ed42d67e6c517c746ff2a6a187016">ssize_t</a> <a class="el" href="pro_8h.html#a6505e7ff3b129d8b17258304886fd133">idaapi</a>&#160;</td><td class="memItemRight" valign="bottom"><b>tag_remove</b> (<a class="el" href="pro_8h.html#a386c10c6aa4340f1d63df85f40454fce">qstring</a> *buf, int init_level=0)</td></tr>
<tr class="separator:ga1cb733a342fb34eb43b7477bd7a409e9"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<h2 class="groupheader">Function Documentation</h2>
<a class="anchor" id="gaf76614959962607fe1e631dff76cfccd"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="pro_8h.html#a8ddba56b40c4be92718f8059abf51147">idaman</a> void <a class="el" href="pro_8h.html#a176294e75f953787714b9d08ffa89adf">ida_export</a> tag_addr </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="pro_8h.html#a386c10c6aa4340f1d63df85f40454fce">qstring</a> *&#160;</td>
          <td class="paramname"><em>buf</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="pro_8h.html#a7b0aeaed04e477c02cf8ea3452002d1a">ea_t</a>&#160;</td>
          <td class="paramname"><em>ea</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">bool&#160;</td>
          <td class="paramname"><em>ins</em> = <code>false</code>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Insert an address mark into a string. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">buf</td><td>pointer to the output buffer; the tag will be appended or inserted into it </td></tr>
    <tr><td class="paramname">ea</td><td>address to include </td></tr>
    <tr><td class="paramname">ins</td><td>if true, the tag will be inserted at the beginning of the buffer </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a class="anchor" id="ga744af50ffec085fea47b9fcd34b366f2"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="pro_8h.html#a8ddba56b40c4be92718f8059abf51147">idaman</a> const char* <a class="el" href="pro_8h.html#a176294e75f953787714b9d08ffa89adf">ida_export</a> tag_advance </td>
          <td>(</td>
          <td class="paramtype">const char *&#160;</td>
          <td class="paramname"><em>line</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>cnt</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Move pointer to a 'line' to 'cnt' positions right. </p>
<p>Take into account escape sequences. </p><dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">line</td><td>pointer to string </td></tr>
    <tr><td class="paramname">cnt</td><td>number of positions to move right </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>moved pointer </dd></dl>

</div>
</div>
<a class="anchor" id="ga772d3586086dab8060e30ca75a40588f"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="pro_8h.html#a8ddba56b40c4be92718f8059abf51147">idaman</a> const char* <a class="el" href="pro_8h.html#a176294e75f953787714b9d08ffa89adf">ida_export</a> tag_skipcodes </td>
          <td>(</td>
          <td class="paramtype">const char *&#160;</td>
          <td class="paramname"><em>line</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Move the pointer past all color codes. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">line</td><td>can't be NULL </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>moved pointer, can't be NULL </dd></dl>

</div>
</div>
<a class="anchor" id="ga8a7428cd65bc8e7630c88460f6790daa"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="pro_8h.html#a8ddba56b40c4be92718f8059abf51147">idaman</a> const char* <a class="el" href="pro_8h.html#a176294e75f953787714b9d08ffa89adf">ida_export</a> tag_skipcode </td>
          <td>(</td>
          <td class="paramtype">const char *&#160;</td>
          <td class="paramname"><em>line</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Skip one color code. </p>
<p>This function should be used if you are interested in color codes and want to analyze all of them. Otherwise <a class="el" href="group__color__conv.html#ga772d3586086dab8060e30ca75a40588f" title="Move the pointer past all color codes. ">tag_skipcodes()</a> function is better since it will skip all colors at once. This function will skip the current color code if there is one. If the current symbol is not a color code, it will return the input. </p><dl class="section return"><dt>Returns</dt><dd>moved pointer </dd></dl>

</div>
</div>
<a class="anchor" id="ga0cfacbd2eae7cf9b49b3df37422a020d"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="pro_8h.html#a8ddba56b40c4be92718f8059abf51147">idaman</a> <a class="el" href="pro_8h.html#ab65ed42d67e6c517c746ff2a6a187016">ssize_t</a> <a class="el" href="pro_8h.html#a176294e75f953787714b9d08ffa89adf">ida_export</a> tag_strlen </td>
          <td>(</td>
          <td class="paramtype">const char *&#160;</td>
          <td class="paramname"><em>line</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Calculate length of a colored string This function computes the length in unicode codepoints of a line. </p>
<dl class="section return"><dt>Returns</dt><dd>the number of codepoints in the line, or -1 on error </dd></dl>

</div>
</div>
<a class="anchor" id="gab05c8906f67ec00e4f3281ba8a67982e"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="pro_8h.html#a8ddba56b40c4be92718f8059abf51147">idaman</a> <a class="el" href="pro_8h.html#ab65ed42d67e6c517c746ff2a6a187016">ssize_t</a> <a class="el" href="pro_8h.html#a176294e75f953787714b9d08ffa89adf">ida_export</a> tag_remove </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="pro_8h.html#a386c10c6aa4340f1d63df85f40454fce">qstring</a> *&#160;</td>
          <td class="paramname"><em>buf</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const char *&#160;</td>
          <td class="paramname"><em>str</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>init_level</em> = <code>0</code>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Remove color escape sequences from a string. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">buf</td><td>output buffer with the string, can not be NULL. </td></tr>
    <tr><td class="paramname">str</td><td>input string, can not be NULL. </td></tr>
    <tr><td class="paramname">init_level</td><td>used to verify that COLOR_ON and COLOR_OFF tags are balanced </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>length of resulting string, -1 if error </dd></dl>

</div>
</div>
</div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.9.1
</small></address>
</body>
</html>
